FCLOSE
Section: MINTLIB LIBRARY FUNCTIONS
(3)
Updated: 3 March 1993
Index
Return to Main Contents
NAME
fclose, fflush - close or flush a stream
SYNOPSIS
#include <stdio.h>
int fclose(FILE *stream);
int fflush(FILE *stream);
DESCRIPTION
fclose writes out any buffered data for the named stream,
and closes the named stream. Buffers allocated by the
standard input/output system are freed.
fclose is performed automatically for all open files upon
calling exit.
fflush writes any unwritten data for an output stream or
an update stream in which the most recent operation was not
input to be delivered to the host environment to the file;
otherwise it is ignored. The named stream remains open.
RETURN VALUES
fclose returns:
0 on success.
EOF if any error (such as trying to write to a file that
has not been opened for writing) was detected.
fflush returns:
0 on success or if the file wasn't open.
EOF if an error was detected while writing the data.
SEE ALSO
close(3),
exit(3),
fopen(3),
setbuf(3)
Index
- NAME
-
- SYNOPSIS
-
- DESCRIPTION
-
- RETURN VALUES
-
- SEE ALSO
-
This document was created by
man2html,
using the manual pages.
Time: 11:14:56 GMT, June 22, 2025